#!/bin/bash
set -o nounset                              # Treat unset variables as an error
echo '
      set terminal epslatex color colortext
      set output "watt_16_streams_rs2nic_final.tex"
      set xlabel "Time(s)"
      set ylabel "Mb/s"
      set key off
f(x) = mean_y
fit f(x) "data/watt_16_streams_rs2nic_final" u 1:3 via mean_y
      set label 3 gprintf("Mean = %gMb/s", mean_y) at  60,16000
      plot "data/watt_16_streams_rs2nic_final" using 1:3 with line title "Total","data/watt_16_streams_rs2nic_final" using 1:9 with line title "Receive 0","data/watt_16_streams_rs2nic_final" using 1:10 with line title "Receive 1","data/watt_16_streams_rs2nic_final" using 1:11 with line title "Receive 2","data/watt_16_streams_rs2nic_final" using 1:12 with line title "Receive 3","data/watt_16_streams_rs2nic_final" using 1:13 with line title "Receive 4","data/watt_16_streams_rs2nic_final" using 1:14 with line title "Receive 5","data/watt_16_streams_rs2nic_final" using 1:15 with line title "Receive 6","data/watt_16_streams_rs2nic_final" using 1:16 with line title "Receive 7","data/watt_16_streams_rs2nic_final" using 1:17 with line title "Receive 8","data/watt_16_streams_rs2nic_final" using 1:18 with line title "Receive 9","data/watt_16_streams_rs2nic_final" using 1:19 with line title "Receive 10","data/watt_16_streams_rs2nic_final" using 1:20 with line title "Receive 11","data/watt_16_streams_rs2nic_final" using 1:21 with line title "Receive 12","data/watt_16_streams_rs2nic_final" using 1:22 with line title "Receive 13","data/watt_16_streams_rs2nic_final" using 1:23 with line title "Receive 14","data/watt_16_streams_rs2nic_final" using 1:24 with line title "Receive 15","data/watt_16_streams_rs2nic_final" using 1:25 with line title "Send 0","data/watt_16_streams_rs2nic_final" using 1:26 with line title "Send 1","data/watt_16_streams_rs2nic_final" using 1:27 with line title "Send 2","data/watt_16_streams_rs2nic_final" using 1:28 with line title "Send 3","data/watt_16_streams_rs2nic_final" using 1:29 with line title "Send 4","data/watt_16_streams_rs2nic_final" using 1:30 with line title "Send 5","data/watt_16_streams_rs2nic_final" using 1:31 with line title "Send 6","data/watt_16_streams_rs2nic_final" using 1:32 with line title "Send 7","data/watt_16_streams_rs2nic_final" using 1:33 with line title "Send 8","data/watt_16_streams_rs2nic_final" using 1:34 with line title "Send 9","data/watt_16_streams_rs2nic_final" using 1:35 with line title "Send 10","data/watt_16_streams_rs2nic_final" using 1:36 with line title "Send 11","data/watt_16_streams_rs2nic_final" using 1:37 with line title "Send 12","data/watt_16_streams_rs2nic_final" using 1:38 with line title "Send 13","data/watt_16_streams_rs2nic_final" using 1:39 with line title "Send 14","data/watt_16_streams_rs2nic_final" using 1:40 with line title "Send 15"
' |gnuplot -persist
